<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const user = {
        firstName: "li",
        lastName: "jack",
        get fullName() { //计算属性
          return `${this.lastName} ${this.firstName}`;
        },
      };
      user.lastName = "tom";
      console.log(user.lastName, user.firstName);
      console.log(user.fullName);
    </script>
  </body>
</html>
